<?php
use yii\helpers\Url;
?>
<script src="/assets/js/echarts.min.js"></script>
    <script type="text/javascript" src="/lib/jquery.raty.min.js"></script>
<div style="background: #2DAD5E;text-align: center;height: 2rem;line-height: 2rem;color: #fff">

    <p>高淳区垃圾分类总体信息</p>

</div>
<div class="weui-cells__title">覆盖户数及参与率</div>


<div class="weui-cells weui-cells_form">
    <?php foreach ($areas as $area){?>
    <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label"><?=$area['areaname']?></label></div>
        <div class="weui-cell__bd">
            <div class="weui-progress">
                <div class="weui-progress__bar">
                    <div class="weui-progress__inner-bar js_progress" style="width: 80%;"></div>
                </div>
                <span style="font-size: 0.6rem"> 123/144 </span>
            </div>
        </div>
    </div>
    <?php }?>
</div>

<div class="weui-cells__title">分类回收量</div>
<?php foreach ($areas as $area){?>
<div id="main<?=$area['id']?>" style="width:100%;height: 15rem"></div>
<script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('main<?=$area['id']?>'));

    // 指定图表的配置项和数据
    var option = {
        title: {
            text: '<?=$area['areaname']?>'
        },
        tooltip: {},
        legend: {
            data:['回收量']
        },
        xAxis: {
            data: ["厨余","可回收","有害","大件","其他"]
        },
        yAxis: {},
        series: [{
            name: '回收量',
            type: 'bar',
            data: [5, 20, 36, 10, 10]
        }]
    };

    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
</script>
<?php }?>

<div class="weui-cells__title">分类质量统计</div>


<div class="weui-cells weui-cells_form">
    <?php foreach ($areas as $area){?>
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label"><?=$area['areaname']?></label></div>
            <div class="weui-cell__bd">
                <div id="star<?=$area['id']?>"></div>
            </div>
        </div>
        <script>
            $(function () {
                $('#star<?=$area['id']?>').raty({
                    number : 5,//星星个数
                    path : '/lib/img',//图片路径
                    half:false,
                    starOn : 'star-on.png',
                    starOff : 'star-off.png',
                    width:"100%",
                    score:5
                });

            })
        </script>
    <?php }?>
</div>

<div class="weui-cells__title">垃圾分类设施统计</div>
<div class="weui-cells weui-cells_form">
    <?php foreach ($areas as $area){?>
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label"><?=$area['areaname']?></label></div>
            <div class="weui-cell__bd">
                堆肥房:100 <br />小型制肥机：100
            </div>
        </div>

    <?php }?>
</div>
<div class="weui-cells__title">环保贡献值</div>

<div class="weui-flex" style="text-align: center;margin-top: 1rem">

    <div class="weui-flex__item"><img style="width: 40%" src="/assets/img/page.png"></div>
    <div class="weui-flex__item"><img style="width: 40%" src="/assets/img/tree.png"></div>
    <div class="weui-flex__item"><img style="width: 40%" src="/assets/img/cloud.png"></div>
</div>
<div class="weui-flex" style="text-align: center">

    <div class="weui-flex__item">纸类回收<br/>50kg</div>
    <div class="weui-flex__item">拯救树木<br/>100颗</div>
    <div class="weui-flex__item">减少碳排放<br/>10000立方米</div>
</div>